<template>
  <div class="newsdetails">
    <el-image style="width: 100%" :src="list.url" fit="cover"></el-image>
    <div class="newsdetails_card">
      <div class="item_center">
        <div class="" v-html="list.content"></div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
      list: "",
    };
  },
  created() {
    this.getData();
  },
  methods: {
    getData() {
      this.$http
        .postRequest("main/article/show", {
          id: this.$route.query.id,
        })
        .then((res) => {
          console.log(res.data);
          if (res.code === 0) {
            this.list = res.data;
          }
        })
        .catch((error) => {
          console.log(error);
        });
    },
  },
};
</script>

<style>
.newsdetails {
  padding-bottom: 30px;
}

.newsdetails_card {
  width: 80%;
  margin: auto;
}

.center_title {
  font-size: 20px;
  margin-top: 20px;
  font-weight: bold;
  color: #000000;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.center_info {
  font-size: 14px;
  font-weight: 400;
  color: #535353;
  margin-top: 30px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
</style>
